package com.example.yuejian.yuejian.bean;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/10/4.
 */

public class ActivityInfo {

    /**
     * id : 1
     * activityname : qqqqqqqqqqqqqq
     * place : 大大连
     * time : 2017-09-12 13:56:13
     * money : 123
     * phone : 12345678
     * photo : http://10.0.2.2/laravel54/public/Uploads/2017-09-04-05-49-33-59ace96d1784c.jpg
     * intro : 1234567890
     * createtime : 2017-09-18 13:56:27
     * nopeople : 1
     * num : 2
     */

    private int id;
    private String activityname;
    private String place;
    private String time;
    private int money;
    private String phone;
    private String photo;
    private String intro;
    private String createtime;
    private String nopeople;
    private String num;

    public static ActivityInfo objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), ActivityInfo.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setActivityname(String activityname) {
        this.activityname = activityname;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public void setNopeople(String nopeople) {
        this.nopeople = nopeople;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public int getId() {
        return id;
    }

    public String getActivityname() {
        return activityname;
    }

    public String getPlace() {
        return place;
    }

    public String getTime() {
        return time;
    }

    public int getMoney() {
        return money;
    }

    public String getPhone() {
        return phone;
    }

    public String getPhoto() {
        return photo;
    }

    public String getIntro() {
        return intro;
    }

    public String getCreatetime() {
        return createtime;
    }

    public String getNopeople() {
        return nopeople;
    }

    public String getNum() {
        return num;
    }
}
